package com.blue.base.oauth.sso.storage.controller;

import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liulei
 * @version 1.0
 */
@RestController
public class UserController {

    /**
     * 获取当前登录用户
     */
    @PostMapping(value = "getUser")
    public String getAll(@AuthenticationPrincipal String username) {
        return username;
    }

    /**
     * 基础接口测试
     */
    @GetMapping("test")
    public String getAll() {
        return "订单服务api访问成功";
    }
}
